from Tkinter import *
import os
os.environ['PATH'] ="C:/Oracle/Client/bin" + os.pathsep +os.environ['PATH'] 
import cx_Oracle
root=Tk()
l1=Listbox()
l1.grid(row=0, column=0)
l1.insert(END, "Emp")
l1.insert(END, "Dept")
l1.insert(END, "Client")
l1.insert(END, "inventaire")
l1.insert(END, "Produit")
l1.insert(END, "Commande")

def insertElement():
    selection=l1.curselection()
    l2.insert(END, l1.get(selection[0]))
    l1.delete(selection)
    pass
def deleteElement():
    delete=l2.curselection()
    l1.insert(END, l2.get(delete[0]))
    l2.delete(delete)
    pass

def TableEmp():
    connection = cx_Oracle.connect("A8ouerhmo/Ferdous286@titan")
    cursor = connection.cursor()
    cursor.execute("""CREATE TABLE Employe1 
(id                         NUMBER(7), 
 last_name                  VARCHAR2(25),   
 first_name                 VARCHAR2(25),
 userid                     VARCHAR2(8),
 start_date                 DATE,
 comments                   VARCHAR2(255),
 manager_id                 NUMBER(7),
 title                      VARCHAR2(25),
 dept_id                    NUMBER(7),
 salary                     NUMBER(11, 2),
 commission_pct             NUMBER(4, 2))""")
    
    cursor.close()
    connection.close()
    print "TERMINE" 
    
            
l2=Listbox()
l2.grid(row=0, column=2)
center=Frame(root)
B=Button(center, text=">", command=insertElement)
B1=Button(center, text="<", command=deleteElement)
bouton= Button(root,text="Creer", command=TableEmp)
bouton.grid(row=1, column=2)
B.pack()
B1.pack()
center.grid(row=0, column=1)
root.mainloop() 

  